﻿<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>后台管理模板</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no">
		<link rel="stylesheet" href="__STATIC__/plugins/layui/css/layui.css" media="all" />
		<link rel="stylesheet" href="__STATIC__/css/global.css" media="all">
		<link rel="stylesheet" href="__STATIC__/plugins/font-awesome/css/font-awesome.min.css">
		 <link rel="icon" href="__STATIC__/images/bitbug_favicon.ico" type="img/x-ico" />
	</head>

	<body>
		<div class="layui-layout layui-layout-admin" style="border-bottom: solid 5px #1aa094;">
			<div class="layui-header header header-demo">
				<div class="layui-main">
					<div class="admin-login-box">
						<a class="logo" style="left: 0;" href="{:url('Index/index')}">
							<span style="font-size: 22px;">蜗居  &nbsp;V1.0.1</span>
						</a>
						<div class="admin-side-toggle">
							<i class="fa fa-bars" aria-hidden="true"></i>
						</div>
						<div class="admin-side-full">
							<i class="fa fa-life-bouy" aria-hidden="true"></i>
						</div>
					</div>
					<form id="icons">
					<ul class="layui-nav admin-header-item">
						<li class="layui-nav-item">
							<a href="javascript:;">清除缓存</a>
						</li>
						<li class="layui-nav-item" id="pay">
							<a href="javascript:;">捐赠我</a>
						</li>
						<li class="layui-nav-item">
							<a href="javascript:;">浏览网站</a>
						</li>
						<li class="layui-nav-item" id="video1">
							<a href="javascript:;">视频</a>
						</li>
						<li class="layui-nav-item">
							<a href="javascript:;" class="admin-header-user">
								<span class="imgflie">
										<input onchange="preview(this)" name="changeicon" id="changeicon" type="file" hidden="hidden" />
										<img id="usericon" src="../../../public/uploads/{$result['adminicon']}.jpg" />
									
								</span> 

								<span class="sapname">{$result['adminname']}</span>
							</a>
							<dl class="layui-nav-child">
								<dd id="avtivedd">
									<a><i class="fa fa-sign-out" aria-hidden="true"></i>更换头像</a>
								</dd>
								<dd>
									<a href="{:url('banklogin')}"><i class="fa fa-sign-out" aria-hidden="true"></i> 注销</a>
								</dd>
							</dl>
						</li>
					</ul>
					<ul class="layui-nav admin-header-item-mobile">
						<li class="layui-nav-item">
							<a href="login.html"><i class="fa fa-sign-out" aria-hidden="true"></i> 注销</a>
						</li>
					</ul>
					<input id="sunbtn" type="submit" hidden="hidden">
					</form>
				</div>
			</div>
			<div class="layui-side layui-bg-black" id="admin-side">
				<div class="layui-side-scroll" id="admin-navbar-side" lay-filter="side">

				</div>
			</div>
			<div class="layui-body" style="bottom: 0;border-left: solid 2px #1AA094;" id="admin-body">
				<div class="layui-tab admin-nav-card layui-tab-brief" lay-filter="admin-tab">
					<ul class="layui-tab-title">
						<li class="layui-this">
							<i class="fa fa-dashboard" aria-hidden="true"></i>
							<cite>控制面板</cite>
						</li>
					</ul>
					<div class="layui-tab-content" style="min-height: 150px; padding: 5px 0 0 0;">
						<div class="layui-tab-item layui-show">
							<iframe src="{:url('main')}"></iframe>
						</div>
					</div>
				</div>
			</div>
			<div class="layui-footer footer footer-demo" id="admin-footer">
				<div class="layui-main">
					<p>2016 &copy;
						<a href="#">m.zhengjinfan.cn/</a> LGPL license 更多模板：<a href="http://www.mycodes.net/" target="_blank">源码之家</a>
					</p>
				</div>
			</div>
			<div class="site-tree-mobile layui-hide">
				<i class="layui-icon">&#xe602;</i>
			</div>
			<div class="site-mobile-shade"></div>

			<!--锁屏模板 start-->
			<script type="text/template" id="lock-temp">
				<div class="admin-header-lock" id="lock-box">
					<div class="admin-header-lock-img">
						<img src="__STATIC__/images/0.jpg" />
					</div>
					<div class="admin-header-lock-name" id="lockUserName">beginner</div>
					<input type="text" class="admin-header-lock-input" value="输入密码解锁.." name="lockPwd" id="lockPwd" />
					<button class="layui-btn layui-btn-small" id="unlock">解锁</button>
				</div>
			</script>
			<!--锁屏模板 end -->
			<script type="text/javascript" src="__STATIC__/lib/jquery/1.9.1/jquery-3.3.1.min.js"></script> 
			<script type="text/javascript" src="__STATIC__/plugins/layui/layui.js"></script>
			<script type="text/javascript" src="__STATIC__/lib/layer/2.4/layer.js"></script>
			<script type="text/javascript" src="__STATIC__/static/h-ui/js/H-ui.min.js"></script> 
			<script type="text/javascript" src="__STATIC__/static/h-ui.admin/js/H-ui.admin.js"></script>
			<script type="text/javascript" src="__STATIC__/datas/nav.js"></script>
			<script type="text/javascript" src="__STATIC__/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
			<script type="text/javascript" src="__STATIC__/lib/jquery.validation/1.14.0/validate-methods.js"></script>
			<script type="text/javascript" src="__STATIC__/lib/jquery.validation/1.14.0/messages_zh.js"></script>
			<script src="__STATIC__/js/index.js"></script>
			<script>
			//触发图片选择
			$(function(){
				$('#usericon').click(function(e){
					$('#changeicon').click();
				});
				$("#avtivedd").click(function(){
					$("#sunbtn").click();
				})
				$("#icons").validate({
					onkeyup:false,
					focusCleanup:true,
					success:"valid",
					submitHandler:function(form){
						$(form).ajaxSubmit({
							type:'post',
							url: "changeicon",
							success: function(data){
								console.log(data)
							}
						});
					}
				});
			})
			
			
			
			function preview(obj){
	                var img = document.getElementById("usericon");
	                img.src = window.URL.createObjectURL(obj.files[0]);
					
	            }
				layui.use('layer', function() {
					var $ = layui.jquery,
						layer = layui.layer;
					$('#video1').on('click', function() {
						layer.open({
							title: 'YouTube',
							maxmin: true,
							type: 2,
							content: 'video.html',
							area: ['800px', '500px']
						});
					});
					$('#pay').on('click', function(e) {
						e.stopPropagation();
						layer.open({
							title: false,
							type: 1,
							content: '<img src="__STATIC__/images/xx.png" />',
							area: ['500px', '250px'],
							shadeClose: true
						});
					});
				});
//				window.onload = function() {
//					document.querySelector(".imgflie").onclick = function() {
//						document.querySelector(".imgflie>input[type=file]").click();
//						document.querySelector(".imgflie>input[type=file]").onchange = function() {
//						}
//					}
//				}
			</script>
		</div>
	</body>

</html>